package com.itany.corejava.code17_设计模式.工厂模式;

import com.itany.corejava.entity.Address;
import com.itany.corejava.entity.User;

import java.util.Date;

/**
 * @author MissChen
 * @date 2024年03月28日 10:11
 */
public class Test {
    public static void main(String[] args) {
        User user= (User) ObjectFactory.getObject("user");
        User user2= (User) ObjectFactory.getObject("user");
        System.out.println(user);
        System.out.println(user2);

        Date date= (Date) ObjectFactory.getObject("date");
        System.out.println(date);

        Address address= (Address) ObjectFactory.getObject("address");
        System.out.println(address);
    }
}
